<?php


namespace frontend\models\cyf;


use yii\db\ActiveRecord;

class Address extends ActiveRecord
{
    public static function tableName()
    {
        return '2008a_address';
    }

    /**
     *获取默认收货地址
     * @param $userId
     * @return mixed
     * @cyf
     */
    public static function getAddrssByUserId($userId)
    {
        return self::find()->where(['user_id'=>$userId,'is_default'=>0])->asArray()->all()[0];
    }
}